function ObjectEncoder() {
	
	this.encode = function(t,o) {
		var sers = new Array();
		var names = new Array();
		var i = 0;
				
		function ser(o) {
									
			if(o == undefined) 
				return "function() { return; };";
			if(o == null) 
				return "function() { return null; };";
			
			if(o.constructor == Function || typeof(o) == "function") {
				return "function() { return " + o + "; };";
			}
			if(o.constructor == Boolean || typeof(o) == "boolean") {
				return "function() { return " + o + "; };";
			}
			if(o.constructor == Number || typeof(o) == "number") { 
				return "function() { return " + o + "; };";
			}
			if(o.constructor == String || typeof(o) == "string") {
				return "function() { return \"" + o + "\"; };";
			}

			for(var h in sers) {
				if(sers[h] == o) {
					return "function() { return " + names[h] + ";};";
				}
			}
			
			names[i] = "tittSerializationID"  + i;
			sers[i++] = o;
			
			var pre = "window.";
			var nam = names[i-1];

			var out = "function() { ";

			if(o.constructor == Array || typeof(o) == "array")
				out += pre + nam + " = new Array();";
			else 
				out += pre + nam + " = new Object();";

			for(var id in o) {
				out += "var id = " + ser(id) + ";";
				out += "var val = " + ser(o[id]) + ";";
				out += nam + "[id()] = val();";
			}
			
			out += "return " + nam + "; };";
			return out;
		}
		
		var out = "function() { var obj = " + ser(o) + ";";
		out += "var inst = obj();";

		for(var nam in names) {
			out += "delete window." + names[nam] + ";";
		}

		out += "return inst; };";
		return escape(out);
		
	}
	
	this.isEncodeable = function(t) {
		return t.isNative();
	}
}